from api.biz.base.base_info import BaseClientApi


class CreateSystemNumber(BaseClientApi):
    def __init__(self):
        super().__init__()
        self.url = f"{self.host}/style/getStyleCode?code=styleNoSystemCode"
        self.method = "get"


class AddStyleApi(BaseClientApi):
    def __init__(self):
        super().__init__()
        self.url = f"{self.host}/style/add"
        self.method = "post"
        self.json = {
            "styleCode": "string",
            "styleName": "精品",
            "categoryId": "string",
            "customerId": "string",
            "colourList": ["黑色", "白色", "红色"],
            "sizeList": [
                {
                    "sizeType": "CN",
                    "sizeValue": "string"
                }
            ],
            "imageList": [{"name": "Snipaste_2024-04-16_20-34-39.png",
                           "url": "http://huberbuy-resource.oss-cn-shanghai.aliyuncs.com/hempel-web_test/2024-05-06/1787387285224865793.png"}]
        }


class AddStyleVersionApi(BaseClientApi):
    def __init__(self,versionId):
        super().__init__()
        self.url = f"{self.host}/styleVersion/copyVersion"
        self.method = "post"
        self.json = {"copyVersionId": versionId, "remark": None}


class StyleCopyApi(BaseClientApi):
    def __init__(self,styleCode,styleId,versionId,newStyleCode):
        super().__init__()
        self.url = f"{self.host}/style/styleCopy"
        self.method = "post"
        self.json = {"styleCode": styleCode, "styleId": styleId,
                     "versionId": versionId,
                     "copyContentList": ["STYLE_MODULE_GY", "STYLE_MODULE_GX", "STYLE_MODULE_BOM",
                                         "STYLE_MODULE_EQUIPMENT", "STYLE_MODULE_FILE"], "newStyleCode":newStyleCode}


class QueryStyleApi(BaseClientApi):
    def __init__(self):
        super().__init__()
        self.url = f"{self.host}/style/page?current=1&size=12"
        self.method = "get"

# 删除款
class DeleteStyleApi(BaseClientApi):
    def __init__(self,styleId):
        super().__init__()
        self.url = f"{self.host}/style/delete"
        self.method = "post"
        self.json = [{"id": styleId}]


# 作废款
class VoidStyleApi(BaseClientApi):
    def __init__(self,styleId):
        super().__init__()
        self.url = f"{self.host}/style/editStatus"
        self.method = "post"
        self.json = [{"id": styleId}]


# 恢复款
class recoveryStyleApi(BaseClientApi):
    def __init__(self,styleId):
        super().__init__()
        self.url = f"{self.host}/style/delete"
        self.method = "post"
        self.json = [{"id": styleId}]
